<template>
  <div id="app">
    <Header />
    <Menu />
    <div class="admin">
      <router-view />
    </div>
  </div>
</template>

<script>
import Menu from "./components/Menu";
import Header from "./components/Header";
import axios from 'axios'

export default {
  name: "App",
  components: {
    Menu,
    Header
  },
  beforeCreate() {
    // 验证登录
    axios
      .get(this.host + "/admin/testLogin")
      .then(r => {
        if (r.data.code == "403") {
          location.href = this.host + "/admin/login";
        }
      }).catch(r=>{
        console.log("已登录");
      });
  }
};
</script>

<style>
</style>
